package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MissingMapper;
import com.ruoyi.system.domain.Missing;
import com.ruoyi.system.service.IMissingService;

/**
 * 物品归还Service业务层处理
 * 
 * @author slh
 * @date 2022-11-28
 */
@Service
public class MissingServiceImpl implements IMissingService 
{
    @Autowired
    private MissingMapper missingMapper;

    /**
     * 查询物品归还
     * 
     * @param id 物品归还主键
     * @return 物品归还
     */
    @Override
    public Missing selectMissingById(Long id)
    {
        return missingMapper.selectMissingById(id);
    }

    /**
     * 查询物品归还列表
     * 
     * @param missing 物品归还
     * @return 物品归还
     */
    @Override
    public List<Missing> selectMissingList(Missing missing)
    {
        return missingMapper.selectMissingList(missing);
    }

    /**
     * 新增物品归还
     * 
     * @param missing 物品归还
     * @return 结果
     */
    @Override
    public int insertMissing(Missing missing)
    {
        return missingMapper.insertMissing(missing);
    }

    /**
     * 修改物品归还
     * 
     * @param missing 物品归还
     * @return 结果
     */
    @Override
    public int updateMissing(Missing missing)
    {
        missing.setStatus(new Long(1));
//        missing.set
        return missingMapper.updateMissing(missing);
    }

    /**
     * 批量删除物品归还
     * 
     * @param ids 需要删除的物品归还主键
     * @return 结果
     */
    @Override
    public int deleteMissingByIds(Long[] ids)
    {
        return missingMapper.deleteMissingByIds(ids);
    }

    /**
     * 删除物品归还信息
     * 
     * @param id 物品归还主键
     * @return 结果
     */
    @Override
    public int deleteMissingById(Long id)
    {
        return missingMapper.deleteMissingById(id);
    }
}
